package com.luozhili.io;

import com.luozhili.io.base.IoDemoBase;

import java.io.*;

public class DataIoDemo extends IoDemoBase {


    public  void output(){
        try {
            DataOutputStream dataOut = new DataOutputStream(new FileOutputStream("file.txt"));
            dataOut.writeChars("abc 123 一二三");
        }catch (IOException e){

        }
    }

    public  void input(){
        try {
            FileInputStream input = new FileInputStream("file.txt");

            DataInputStream datainput = new DataInputStream(input);
            while (datainput.available()>0){
                System.out.println(datainput.readChar());
            }
            datainput.close();
            input.close();
        }catch (IOException e){

        }

    }
}
